package com.ai.bitcoin.jpa.entity;

import lombok.Data;

import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;
import java.util.Objects;

@Entity
@Table(name = "redeem_code")
@Data
public class RedeemCode extends Identity{

    private Integer type;

    private String code;

    private Integer status;

    private String data;

    private Date createTime;

    private Date updateTime;

    private String remark;

    private Date expiredDate;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        if (!super.equals(o)) return false;
        RedeemCode that = (RedeemCode) o;
        return Objects.equals(code, that.code);
    }

    @Override
    public int hashCode() {

        return Objects.hash(super.hashCode(), code);
    }
}
